package com.test;

import ibatis.Users;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import com.bingo.dao.NewsDAO;
import com.bingo.dao.UsersDAO;



public class testMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ApplicationContext context=new ClassPathXmlApplicationContext("classpath:springConfig/applicationContext.xml");
		UsersDAO userdao=(UsersDAO)context.getBean("usersDao");
		List<Users> userList=new ArrayList<Users>();
		try {
		 userList=userdao.getAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		if(userList.size()>0)
		{
			for (Users u : userList) {
				System.out.println("uid:"+u.getUid()+"  uname:"+u.getUsername());
			}
		}

	}

}
